package cn.cds.withyou.lib.model;

import android.database.Cursor;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

import cn.cds.withyou.lib.Constants;

/**
 * <p> Description: </p>
 * <p/>
 * <p> Copyright: Copyright (c) 2016 </p>
 *
 * @author: Json.Lee
 * @Version: 1.0
 * @CreateTime: 28/4/2016 22:55
 */
public class GameDto implements Serializable {

    private String id;
    private String gameName;
    private long signupStartT;
    private long signupEndT;
    private long gameStartT;
    private long gameEndT;
    private String gameContent;
    private String gamePic;

    public GameDto () {

    }

    public GameDto (Cursor cursor) {
        id = cursor.getString(cursor.getColumnIndex(Constants._ID));
        gameName = cursor.getString(cursor.getColumnIndex(Constants.Game._GAME_NAME));
        signupStartT = Timestamp.valueOf(cursor.getString(cursor.getColumnIndex(Constants.Game._SIGNUP_START_TIME))).getTime();
        signupEndT = Timestamp.valueOf(cursor.getString(cursor.getColumnIndex(Constants.Game._SIGNUP_END_TIME))).getTime();
        gameStartT = Timestamp.valueOf(cursor.getString(cursor.getColumnIndex(Constants.Game._GAME_START_TIME))).getTime();
        gameEndT = Timestamp.valueOf(cursor.getString(cursor.getColumnIndex(Constants.Game._GAME_END_TIME))).getTime();
        gameContent = cursor.getString(cursor.getColumnIndex(Constants.Game._GAME_CONTENT));
        gamePic = cursor.getString(cursor.getColumnIndex(Constants.Game._GAME_PIC));
        player = new ArrayList<>();
    }

    private List<UserDto> player;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getGameName() {
        return gameName;
    }

    public void setGameName(String gameName) {
        this.gameName = gameName;
    }

    public long getSignupStartT() {
        return signupStartT;
    }

    public void setSignupStartT(long signupStartT) {
        this.signupStartT = signupStartT;
    }

    public long getSignupEndT() {
        return signupEndT;
    }

    public void setSignupEndT(long signupEndT) {
        this.signupEndT = signupEndT;
    }

    public long getGameStartT() {
        return gameStartT;
    }

    public void setGameStartT(long gameStartT) {
        this.gameStartT = gameStartT;
    }

    public long getGameEndT() {
        return gameEndT;
    }

    public void setGameEndT(long gameEndT) {
        this.gameEndT = gameEndT;
    }

    public String getGameContent() {
        return gameContent;
    }

    public void setGameContent(String gameContent) {
        this.gameContent = gameContent;
    }

    public String getGamePic() {
        return gamePic;
    }

    public void setGamePic(String gamePic) {
        this.gamePic = gamePic;
    }

    public List<UserDto> getPlayer() {
        return player;
    }

    public void setPlayer(List<UserDto> player) {
        this.player = player;
    }
}
